home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2002 #4 / K-CD-4-2002.ISO / Empire Earth / EEDemo.exe / Disk1 / data.ssa / unit ai scripts_load container.tai < prev    next >
Encoding:
Text File  |  2001-09-29  |  1.6 KB  |  59 lines

  1. //
  2. //    Load Container AI file
  3. //
  4. //    Behaviors:
  5. //
  6. //        Path to passengers.  Let them load.  Path to unload point.  Unload passengers
  7. //
  8. //    Notes:
  9. //        This overloads a few of the generic movement actions
  10. //
  11. //    Known Problems:
  12. //
  13. //    Usage:
  14. //
  15. //        To tell a unit to move to a location, give it a load/unload transport goal (EEUGLoad/UnloadTransport)
  16. //            and set its action to keeuaPrepareToMove.
  17. //
  18.  
  19. BumpExtraLoadableUnits
  20. {
  21.     ExtraLoadableUnitsBumped true(TurnToUnitFacing)
  22. }
  23.  
  24. // assumption: action only valid for GoalIsTransport - order
  25. PickedUpLoadableUnits
  26. {
  27.     ContainerIsFull true(BumpExtraLoadableUnits)
  28.     allof(CanIMove,NoMoreWaypoints) true(TurnToUnitFacing)
  29.     allof(CanIMove,NoMoreLoadableUnitsToPickUp) true(TurnToUnitFacing) 
  30.     CanIMove true(Advance)
  31.     NoMoreLoadableUnitsToPickUp true(Idle)
  32. }
  33.  
  34. // is pathfinding complete?
  35. PrepareToMove
  36. {
  37.     allof(GoalIsLoadContainer,NoMoreLoadableUnitsToPickUp) true(TurnToUnitFacing)
  38. }
  39.  
  40. // turn to unit facing as specified in the location goal, if required
  41. TurnToUnitFacing
  42. {
  43.     anyof(UnitFacingNotRequired,CompletedUnitFacing) true(ReacquireGoal)
  44.     GoalIsLocation false(ReacquireGoal)
  45. }
  46.  
  47. // we've reached the end of the path
  48. ReacquireGoal
  49. {
  50.     allof(GoalIsLoadContainer,HaveNotReachedRendezvousPoint,MoreLoadableUnitsToPickUp) true(PrepareToMove)
  51.     allof(GoalIsLoadContainer,HaveReachedRendezvousPoint,MoreLoadableUnitsToPickUp) true(WaitForPassengers)
  52.     GoalIsLoadContainer    true(Idle)
  53. }
  54.  
  55. // computer player transports wait for their passengers
  56. WaitForPassengers
  57. {
  58.     NoMoreLoadableUnitsToPickUp true(Idle)
  59. }